import api from '../../utils/api';

Page({
  data: {
    img: '../../static/image/audio.jpg',
    TingliList: []
  },

  onLoad: function (options) {
    this.getTingliList();
  },

  // 请求听力列表
  getTingliList() {
    const _this = this;
    wx.showLoading({
      title: '请稍后...'
    });
    api({
      url: '/User/queryListening',
      method: 'GET',
      success: function (res) {
        wx.hideLoading();
        _this.setData({
          TingliList: res.data.data
        });
      }
    });
  },

  toTingli(e) {
    const { id } = e.currentTarget.dataset;
    wx.navigateTo({
      url: './tingliDetail/tingliDetail?id=0' + id,
    });
  }
})